package com.sunshin.staticfactorymethod;

/**
 *
 * 单列模式
 *
 * @Author: WeiHong
 * @Date: 2017/3/28 10:35
 */
public class Singleton {

    private Singleton() {
    }

    private static final Singleton singleton = null;

    public static final Singleton getInstance(){
        if (singleton == null){
            return new Singleton();
        }
        return singleton;
    }

}
